package com.walleipt.corgi.api.controller;

import java.util.List;

import org.mangoframework.core.annotation.Get;
import org.mangoframework.core.annotation.RequestMapping;
import org.mangoframework.core.annotation.RequestParam;

import com.walleipt.corgi.api.data.bean.Interface;
import com.walleipt.corgi.api.data.bean.Project;
import com.walleipt.corgi.api.ex._HashMap;
import com.walleipt.corgi.api.service.ServiceFactory;

/**
 * 
 * 导出
 *
 * @author walleipt
 * @date 2017-04-12
 */
@RequestMapping("/export")
public class ExportController {

	@Get("/{projectId}/{moduleId}")
	public Object getExport(@RequestParam("projectId") String projectId, @RequestParam("moduleId") String moduleId) {

		Project project = ServiceFactory.instance().getById(projectId, Project.class);
		List<Interface> interfaces = ServiceFactory.instance().getInterfacesByModuleId(moduleId);

		return new _HashMap<>().add("project", project).add("interfaces", interfaces);

	}
 


}
